AssociationExample
by Mai Nguyen, NeXT Developer Support Team

Overview

The current version of DBKit does not provide a way to filter the records fetched by a detail FetchGroup. DBKit does not allow a qualifier to be built into a relationship, nor does it allow a qualifier to be permanently attached to a FetchGroup. The Association example provides a way to do filtering of detail records by using a subclass of DBAssociation that replaces the default association which exists between the master FetchGroup and the detail FetchGroup. In this example, the user can change the criteria of the qualifier by entering a new value in the quantity field and pressing the Fetch: button. The example is built such that you can easily reuse the object QualifiedAssociation in your custom application.
In order to run this application, you need to have access to a Sybase server and a pubs demo database.

Important Notes

For 3.0 NEXTSTEP: You need to install the SybaseDemo.dbmodel into your ~/Library/Databases directory.
For 3.1 NEXTSTEP: The SybaseDemo.dbmodela file in this project directory will be converted to a .dbmodel file at compile time, and you'll be using it instead of the SybaseDemo.dbmodel stored in your ~/Library/Databases directory.

Program Organization

Major Classes in the Application

Controller	A general tester object.  This object is for testing whether the custom association works 	properly. It is managing the UI of this example.

 QualifiedAssocition	A subclass of  DBAssociation. It overrides the method called when fetching, and add some new methods for setting up the proper qualifier. 

Topics Of Interest

- How to set up a new DBAssociation between the master fetchgroup and the detail fetchgroup 
See the C function  setUpAssociaiton() in the file QualifiedAssociation.m.

Last Edited: July 1993

Valid for 3.0, 3.1